package com.qq.springbootdemo.service;

import com.qq.springbootdemo.common.exception.InsufficientBalanceException;
import com.qq.springbootdemo.common.exception.WalletNotFoundException;
import com.qq.springbootdemo.domain.entity.TransactionEntity;
import com.qq.springbootdemo.domain.entity.WalletEntity;

import java.math.BigDecimal;
import java.util.List;

// 钱包服务接口
public interface WalletService {
    WalletEntity createWallet(Long userId, String currency);
    WalletEntity getWallet(Long walletId);
    BigDecimal getBalance(Long walletId);
    void deposit(Long walletId, BigDecimal amount);
    void withdraw(Long walletId, BigDecimal amount) throws InsufficientBalanceException;
    void transfer(Long fromWalletId, Long toWalletId, BigDecimal amount) 
        throws InsufficientBalanceException, WalletNotFoundException;
    List<TransactionEntity> getTransactionHistory(Long walletId);
}